package com.gitee.wsl.text.regex.sample


const val HEX_RADIX = 16
const val DECIMAL_RADIX = 10
const val OCTAL_RADIX = 8

val Regex.Companion.HEX_REGEX get() = "^(?:0[xX])?[\\da-fA-F]+$".toRegex()
val Regex.Companion.HEX_WITH_LEAD_REGEX get() = "^0[xX][\\da-fA-F]+$".toRegex()
val Regex.Companion.HEX_LEAD_REGEX get() = "^0[xX]".toRegex()
val Regex.Companion.BINARY_LEAD_REGEX get() = "^0[bB]".toRegex()
val Regex.Companion.OCTAL_LEAD_REGEX get() = "^0[oO]".toRegex()

val Regex.Companion.OCTAL_REGEX get() = "^(?:0[oO])?[0-7]+$".toRegex()

val Regex.Companion.BINARY_REGEX get() = "^(?:0[bB])?[01]+$".toRegex()
